home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- import wx
- from wx import HyperlinkCtrl, TRANSPARENT_WINDOW, HL_DEFAULT_STYLE
- from config import platformName
-
- def clearlink_url(url):
- if callable(url):
- callback = url
- url = '^_^'
- else:
- callback = None
- return (callback, url)
-
-
- class ClearLink(HyperlinkCtrl):
- callback = None
-
- def __init__(self, parent, id, label, url, style = HL_DEFAULT_STYLE, pos = wx.DefaultPosition):
- (callback, url) = clearlink_url(url)
- if callback is not None:
- self.callback = callback
-
- if platformName == 'win':
- style = style | TRANSPARENT_WINDOW
-
- HyperlinkCtrl.__init__(self, parent, id, label, url, pos = pos, style = style)
- Bind = self.Bind
- if platformName == 'win':
- self.dopaint = True
- self.min = False
- self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
- Bind(wx.EVT_PAINT, self.OnPaint)
- Bind(wx.EVT_MOTION, self.OnMouseMotion)
- Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
-
- Bind(wx.EVT_HYPERLINK, self.OnHyperlink)
-
-
- def OnHyperlink(self, e):
- if self.callback is not None:
- self.callback()
- else:
- e.Skip()
-
- if platformName == 'win':
-
- def OnMouseMotion(self, event):
- if not self.min:
- self.min = True
- event.Skip()
-
-
-
- def OnMouseLeave(self, event):
- self.min = False
- event.Skip()
-
-
- def OnPaint(self, event):
- if self.dopaint:
- self.dopaint = False
- event.Skip()
- else:
- self.dopaint = True
- self.Parent.RefreshRect(self.Rect)
-
-
-
-